package com.goddess.yeecolor.fragment.ExerciseitemFragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;

import com.goddess.yeecolor.R;
import com.goddess.yeecolor.base.BaseFragment;
import com.goddess.yeecolor.tools.LogUtils;

/**
 * 活动安排
 */
public class ExerciseItem_activityArrange extends BaseFragment {

    private WebView fragment_arrange_webview;
    private View mView;
    private String webView;
    private Bundle mBundle;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        if (mView==null){
            mView=inflater.inflate(R.layout.fragment_activityarrange,container,false);
            mBundle=getArguments();

            if (mBundle!=null){
                LogUtils.getInstence().info("web"+mBundle.getString("webView"));
                webView=mBundle.getString("webView");
            }
            initFindView();
        }
        return mView;
    }

    public static ExerciseItem_activityArrange newInstance(String webView) {
        ExerciseItem_activityArrange newFragment = new ExerciseItem_activityArrange();
        Bundle bundle = new Bundle();
        bundle.putString("webView",webView);
        newFragment.setArguments(bundle);
        return newFragment;
    }


    @Override
    public void initOnClck() {

    }

    @Override
    public void initFindView() {
        fragment_arrange_webview= (WebView) mView.findViewById(R.id.fragment_arrange_webview);
        fragment_arrange_webview.getSettings().setJavaScriptEnabled(true);
        fragment_arrange_webview.setWebChromeClient(new WebChromeClient());


        fragment_arrange_webview.loadUrl(webView);
    }


    @Override
    public void initData() {

    }

    @Override
    public void onDestroy() {
        super.onDestroy();

    }
}